<?php $this->load->view('admin/adhead.html'); ?>
<?php $this->load->view('admin/adsider.html'); ?>
<style type="text/css">
<!--
.shr { margin-top:0}
-->
</style>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">

    <!-- Main content -->
    <section class="content">

      <div class="row">
        <div class="col-md-3">

          <!-- Profile Image -->
          <div class="box box-primary">
            <div class="box-body box-profile">
              <img class="profile-user-img img-responsive img-circle" src="<?=$userpic?>" alt="User profile picture">

              <h3 class="profile-username text-center"><?=$user->name?></h3>

              <p class="text-muted text-center"><?=$user->email?></p>

			  <ul class="list-group list-group-unbordered">
                <li class="list-group-item"><a href="#">发表文章数 <span class="pull-right badge bg-blue">31</span></a></li>
                <li class="list-group-item"><a href="#">评论数 <span class="pull-right badge bg-green">5</span></a></li>
                <li class="list-group-item"><a href="#">获赞数 <span class="pull-right badge bg-red">12</span></a></li>
              </ul>
				<a href="<?php echo site_url('admin/profile'); ?>" class="btn btn-primary btn-block"><b>退&nbsp;&nbsp;出&nbsp;&nbsp;编&nbsp;&nbsp;辑</b></a>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->

          <!-- About Me Box -->
          <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">About Me</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <strong><i class="fa fa-book margin-r-5"></i> College</strong>

              <p class="text-muted"><?=$user->college?></p>

              <hr class="shr">

              <strong><i class="fa fa-map-marker margin-r-5"></i> Location</strong>

              <p class="text-muted"><?=$user->location?></p>

              <hr class="shr">

              <strong><i class="fa fa-pencil margin-r-5"></i> Skills</strong>

              <p>
                <span class="label label-danger">UI Design</span>
                <span class="label label-success">Coding</span>
                <span class="label label-info">Javascript</span>
                <span class="label label-warning">PHP</span>
                <span class="label label-primary">Node.js</span>
              </p>

              <hr class="shr">

              <strong><i class="fa fa-file-text-o margin-r-5"></i> Notes</strong>

              <p><?=$user->notes?></p>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
        <div class="col-md-9">
          
          <div class="box box-danger">
            <div class="box-header with-border">
              <h3 class="box-title">编辑头像</h3>
            </div>

			<div class="box-body">
				<div class="form-group">
					<label for="radiofileimg" class="col-sm-2 control-label"><input type="radio" id="radiofileimg" name="userimg" value="imgfile">&nbsp;&nbsp;上传图片</label>
                  <form role="form" method="post" id="userimgfile" action="<?php echo site_url('admin/userimgedit'); ?>" enctype="multipart/form-data">
				  <div class="col-sm-10">
                    <input type="file" name="userfile" id="inputfileimg"><p class="help-block">请上传.jpg .png 格式,尺寸160*160px左右，大小不超过100KB的图片</p>
                  </div>
				  </form>

                </div>

				<div class="form-group">
					<label for="radioimgurl" class="col-sm-2 control-label"><input type="radio" id="radioimgurl" name="userimg" value="imgurl">&nbsp;&nbsp;图片地址</label>
                  <form role="form" method="post" id="userimgurl" action="<?php echo site_url('admin/userimgurl'); ?>">
				  <div class="col-sm-10">
                    <input type="text" class="form-control" name="imgurl"  id="inputfileurl" placeholder="图片地址">
                  </div>
				  </form>

                </div>
			
			</div>        


              <div class="box-footer">
                <button type="button" id="imgpost" class="btn btn-primary">提交</button>
              </div>
			  
          </div>
		  <!-------------编辑头像--------------->

		  <div class="box box-success">
            <div class="box-header with-border">
              <h3 class="box-title">编辑资料<small>&nbsp;&nbsp;&nbsp;&nbsp;不改请留空</small></h3>
            </div>
            <form class="form-horizontal" method="post" action="<?php echo site_url('admin/userinfoedit'); ?>">
			<div class="box-body">
				
				<div class="form-group">
                  <label for="inputname" class="col-sm-2 control-label">名称</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="name" id="inputname" placeholder="昵称">
                  </div>
                </div>

				<div class="form-group">
                  <label for="inputemail" class="col-sm-2 control-label">邮箱</label>

                  <div class="col-sm-10">
                    <input type="email" class="form-control" name="email" id="inputemail" placeholder="邮箱">
                  </div>
                </div>

				<div class="form-group">
                  <label for="inputcollege" class="col-sm-2 control-label">毕业高校</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="college" id="inputcollege" placeholder="毕业高校">
                  </div>
                </div>

				<div class="form-group">
                  <label for="inputlocation" class="col-sm-2 control-label">常住地</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="location" id="inputlocation" placeholder="常住地">
                  </div>
                </div>

				<div class="form-group">
                  <label for="inputskills" class="col-sm-2 control-label">兴趣技能</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="skills" id="inputskills" placeholder="兴趣爱好、技能，每个用','符号隔开">
                  </div>
                </div>

				<div class="form-group">
                  <label for="textareanote" class="col-sm-2 control-label">个人说明</label>

                  <div class="col-sm-10">
                    <textarea class="form-control" name="notes" id="textareanote" rows="3"></textarea>
                  </div>
                </div>

                </div>


              <div class="box-footer">
                <button type="submit" class="btn btn-primary">提交</button>
              </div></form>
          </div>

        </div>
        <!-- /.col -->
      </div>
      <!-- ./row -->

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

<?php $this->load->view('admin/adfooterueditor.html'); ?>

<script type="text/javascript">
<!--
	$(function(){
		$(":radio[name='userimg']").click(function(){
			switch($(this).val()){
				case 'imgfile':
					$("#inputfileimg").removeAttr("disabled");
					$("#inputfileurl").attr("disabled","disabled");
					break;
				case 'imgurl':
					$("#inputfileurl").removeAttr("disabled");
					$("#inputfileimg").attr("disabled","disabled");
					break;
			}
		});

		$("#imgpost").click(function(){
			var radiockres = $(":radio[name='userimg']:checked").val();
			switch(radiockres){
				case 'imgfile':
					$("#userimgfile").submit();
					break;
				case 'imgurl':
					$("#userimgurl").submit();
					break;
				default:
					alert("请选择头像上传方式");
			}
		});
	
	});
//-->
</script>